<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('用户列表')" />
    <style>
        .card-header + .card-body {
            height: 500px;
        }
        #d1{
            display: flex;
            justify-content: center;
            align-items: center;
        }
    </style>
</head>
<body>

<div class="row">
    <div class="col-sm-6 col-lg-3">
        <div class="card bg-primary">
            <div class="card-body clearfix">
                <div class="pull-right">
                    <p class="h6 text-white m-t-0">总收入</p>
                    <p class="h3 text-white m-b-0">
                        <span th:if="${#httpSession.getAttribute('orderMoney')!=null}" th:text="${#httpSession.getAttribute('orderMoney')}"></span>
                        <span th:if="${#httpSession.getAttribute('orderMoney')==null}">暂无收入</span>

                    </p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-currency-cny fa-1-5x"></i></span> </div>
            </div>
        </div>
    </div>

    <div class="col-sm-6 col-lg-3">
        <div class="card bg-danger">
            <div class="card-body clearfix">
                <div class="pull-right">
                    <p class="h6 text-white m-t-0">订单总数</p>
                    <p class="h3 text-white m-b-0">
                        <span th:if="${#httpSession.getAttribute('orderNum')!=null}" th:text="${#httpSession.getAttribute('orderNum')}"></span>
                        <span th:if="${#httpSession.getAttribute('orderNum')==null}">暂无订单</span>
                    </p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account fa-1-5x"></i></span> </div>
            </div>
        </div>
    </div>

    <div class="col-sm-6 col-lg-3">
        <div class="card bg-success">
            <div class="card-body clearfix">
                <div class="pull-right">
                    <p class="h6 text-white m-t-0">店铺评分</p>
                    <p class="h3 text-white m-b-0">
                        <span th:if="${#httpSession.getAttribute('appAvg')!=null}" th:text="${#httpSession.getAttribute('appAvg')}"></span>
                        <span th:if="${#httpSession.getAttribute('appAvg')==null}">暂无评分</span>

                    </p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-arrow-down-bold fa-1-5x"></i></span> </div>
            </div>
        </div>
    </div>

    <div class="col-sm-6 col-lg-3">
        <div class="card bg-purple">
            <div class="card-body clearfix">
                <div class="pull-right">
                    <p class="h6 text-white m-t-0">店铺评价</p>
                    <p class="h3 text-white m-b-0">
                        <span th:if="${#httpSession.getAttribute('appNum')!=null}" th:text="${#httpSession.getAttribute('appNum')}"></span>
                        <span th:if="${#httpSession.getAttribute('appNum')==null}">暂无评价</span>
                    </p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-comment-outline fa-1-5x"></i></span> </div>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-header">
                <h4>最近订单(仅显示最近十条)</h4>
            </div>
            <div class="card-body">
                <div class="table-responsive" id="d1">
                    <table th:if="${#httpSession.getAttribute('order')!=null}" class="table table-hover">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>订单编号</th>
                            <th>下单时间</th>
                            <th>商品</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="order,var:${#httpSession.getAttribute('order')}">
                            <td th:text="${var.count}"></td>
                            <td th:text="${order.orderId}"></td>
                            <td th:text="${order.orderTime}"></td>
                            <td th:text="${order.disheName}"></td>
                            <td th:if="${order.status=='0'}">
                                <span  class="badge badge-success">进行中</span>
                            </td>
                            <td th:if="${order.status=='1'}">
                                <span  class="badge badge-success">完成</span>
                            </td>
                            <td th:if="${order.status=='2'}">
                                <span  class="badge badge-success">退款中</span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <h1 style="color: #d4d4d4" th:if="${#httpSession.getAttribute('order')==null}">
                        暂无订单
                    </h1>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>